Public Class clsLoginSD
    Inherits clsBaseDatos

    'Carga Almacen, edu 15 Jun 06
    Public Function leeAlmacenSD() As DataSet
        Dim sql As String
        Try
            sql = "Select isnull(CAST(parValor AS INT), 1) FROM Parametros WHERE parNombre = 'NoTienda'"
            Return MyBase.TraerDataSet(sql)

        Catch ex As Exception
            MsgBox(ex.Message, MsgBoxStyle.Exclamation)
        End Try
    End Function

    'Carga Empresa, edu 15 Jun 06
    Public Function leeEmpresaSD() As DataSet
        Dim sql As String
        Try
            sql = "Select isnull(CAST(parValor AS INT), 1) FROM Parametros WHERE parNombre = 'NoEmpresa'"
            Return MyBase.TraerDataSet(sql)

        Catch ex As Exception
            MsgBox(ex.Message, MsgBoxStyle.Exclamation)
        End Try
    End Function

    Public Function leeDatosEmpleado(ByVal strEmlUsuario As String, _
                                     ByVal strPassword As String) As DataSet
        Dim strSql As String

        Try
            strSql = "Select * " _
                & "From cEmpleados " _
                & "Where emlUsuario = '" & strEmlUsuario & "' And Password = '" & strPassword & "' " _
                    & "and aplFolio = " & cParametros.Aplicacion & " " _
                & "Order By Id Desc"
            Return MyBase.TraerDataSet(strSql)

        Catch ex As Exception
            MsgBox(ex.Message, MsgBoxStyle.Exclamation)
        End Try
    End Function

    Public Function leeBanderasPermisos(ByVal TipoEmpleado As Integer) As DataSet
        Dim sql As String

        Try
            sql = "Select * " _
                & "From TiposUsuarios " _
                & "Where nIdTipoUsuario = " & TipoEmpleado
            Return MyBase.TraerDataSet(sql)

        Catch ex As Exception
            MsgBox(ex.ToString, MsgBoxStyle.Critical, ex.TargetSite.Name)
        End Try
    End Function
End Class
